﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using AgilePlannerDT.Display.Impl;
using AgilePlannerDT.Data;
using AgilePlannerDT.Application;

namespace AgilePlannerDT.Display.Impl
{
    /// <summary>
    /// Interaction logic for MousePointer.xaml
    /// 
    /// 
    /// </summary>
    /// 


    public partial class MousePointer : DisplayObjectImpl
    {
        private string newMouseName;
        private MouseMove mouseMoveDataObject;
       
        public MousePointer(MouseMove move,AgilePlannerApplication mainWindow)
            : base(mainWindow)
        {
            InitializeComponent();
            this.newMouseName = move.Name;
            this.mouseName.Content = this.newMouseName;
            InitializeTransformations();
            InitializeAnimations();
            //scale the mouse movement
            trans.X = move.LocationX*Properties.Settings.Default.Scale;
            trans.Y = move.LocationY*Properties.Settings.Default.Scale;
            this.mouseMoveDataObject = move;
        }

        public void Update(MouseMove move)
        {
            this.newMouseName = move.Name;
            this.mouseName.Content = this.newMouseName;
            this.mouseMoveDataObject = move;
            trans.X=move.LocationX*Properties.Settings.Default.Scale;
            trans.Y=move.LocationY*Properties.Settings.Default.Scale;
            this.BringToFront();
        }

        public MouseMove GetMouseMoveDataObject()
        {
            return this.mouseMoveDataObject;
        }
 
    }
}
